Repository navigation
An SLCN history record takes one route on every rank, an empty rank included - #1237
Conversation
…ncluded In parallel the semi-Lagrangian history records the current field by copying the tracked variable's nodal data. On a rank with no nodes the copy's reshape(0, -1) raised (NumPy cannot infer -1 from zero elements), the exception sent that rank alone to evaluate psi_fn, and the two routes enter different collectives: an SLCN step hung at np 3 with an empty rank (found in the review of #1234). The column counts now come from the arrays' trailing shape, and the ranks agree on the route with a logical AND. Underworld development team with AI support from Claude Code
…without an empty rank Both runs take the parallel route, so the comparison does not depend on the serial record's centroid nudge; a loose check holds x + y. Underworld development team with AI support from Claude Code
|
Review from the Underworld development team with AI support from Claude Code (H1: review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)) Verdict at 12f13bb: changes requested. The fix is right. With an empty rank, every rank now takes the same route for the history record. The step that hangs on development completes on this branch, both on the test's triangle and on a gmsh box. One thing blocks the merge: the PR's own new test fails here at np 3. Its value comparison asks for 1e-10 between two partitions, and the two partitions differ by 2.4e-9. The fix is a one-line tolerance change. The PR changes only Findings
ProbesThe new test at np 3.
The record's route on each rank. I instrumented
np 1 against np 3 (two steps on the test's triangle, the field x + y):
Node positions agree exactly across all three runs. The author's 7.5e-5 is np 1's distance from x + y: serially the record takes the nudged evaluate route. The np 3 to np 1 difference is 5.0e-5, smaller than that, because the np 3 copy route sits closer to x + y. Both are well inside the test's 1e-4. Empty rank on a gmsh box (np 3, cells 121 / 121 / 0, three SLCN steps of a rotating flow):
What was run
Not run:
Logs kept by the reviewer. Underworld development team with AI support from Claude Code |
… tolerance (review of #1237) At a tolerance of 1e-10 two partitions differ by 2.4e-9 (measured by the reviewer at np 3); the bound is now 100 times the tolerance. The docstring gives the reviewer's route numbers: neither route holds x + y exactly. Underworld development team with AI support from Claude Code
A follow-up to the review of #1234, which found it. No issue is filed.
What changes
In parallel,
SemiLagrangian._record_current_field_into_historyrecords the current field by copying the tracked variable's nodal data (_record_psi_star_from_field_data). On a rank with no nodes:reshape(0, -1)raisedValueError, because NumPy cannot infer-1from zero elements.exceptreturnedNone, which sent that rank alone to evaluatepsi_fn.The reviewer saw this at np 3 with an empty rank. It affects every SLCN solver with an empty rank, not only the level set.
Now:
Serial runs are unchanged: the copy is not used serially.
Tolerances and coordinate matches
The test runs two SLCN steps of the steady field x + y twice at the same rank count:
Both take the parallel route.
Tests
tests/parallel/test_1236_slcn_step_on_an_empty_rank_parallel.py: the empty-rank triangle ofempty_rank_fixtures, withAll_Boundariesmarked on every rank, and a 300 s timeout, so a hang fails.scripts/test.shruns it at np 3.Serial SLCN, SUPG and semi-Lagrangian files on this branch: 148 passed, 1 skipped.
Adversarial review (author's pass)
allreduceruns wheneveruw.mpi.size > 1, the same on every rank. The record is reached on every rank, fromupdate_pre_solve. The serial path has no collective.try/exceptfalls back to a projection solve if_history_evaluateraises. An exception raised on some ranks only would still split the ranks. This change does not touch that path.Underworld development team with AI support from Claude Code